package com.diors.commons.network.server;

import java.net.InetSocketAddress;

import com.diors.commons.network.DispatcherHandler;

/**
 * 抽象服务器
 * @author	darren.ouyang
 * @data	2013-9-9
 */
public abstract class AbstractServer 
{

	/* 服务器调度器 */
	protected DispatcherHandler dispatcher;
	
	/* 服务器绑定的端口地址 */
	protected InetSocketAddress address;
	
	public AbstractServer(DispatcherHandler dispatcher, InetSocketAddress address)
	{
		this.dispatcher = dispatcher;
		this.address = address;
	}
	
	/**
	 * 开启连接方法
	 * @create	2013-9-9	darren.ouyang
	 */
	public abstract void open ();
	
	/**
	 * 关闭连接方法
	 * @create	2013-9-9	darren.ouyang
	 */
	public abstract void close ();
	
}
